import  yagmail
import logging

class Tools():
    def send_email(self,subject,filename):
        send=yagmail.SMTP(user='1419002374@qq.com',password='pblpfajgpwcohfea',host='smtp.qq.com')
        send.send(to='1419002374@qq.com',subject=subject,contents='测试报告',attachments=filename)


    def log_info(self,filename,filemode):
        logging.basicConfig(filename=filename,filemode=filemode,level=logging.DEBUG,format='%(name)s-%(levelname)s-%(filename)s-%(asctime)s')